Rdson-based current sensing system

ABSTRACT

A device includes a current mirror, a switch, first and second current paths, first and second buffers, a variable resistor, a temperature-sensing circuit, and a controller. The first current path is coupled between the current mirror&#39;s input and the switch. The switch switches between ground and a transistor based on a control signal. The second current path is coupled between a first current mirror output and ground. The first buffer is coupled to a second current mirror output. The second buffer is coupled to the variable resistor, which is coupled to the first buffer. The temperature-sensing circuit provides a device temperature to the controller, which is coupled to a first buffer output and determines a first adjustment to the first and second current paths and a second adjustment to the variable resistor based on the device temperature.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Patent Application No. 63/152,702 filed Feb. 23, 2021, which is hereby incorporated by reference.

BACKGROUND

In many DC/DC converters, the output current is monitored to protect inductors of the DC/DC converter, to determine loading on the DC/DC converter, and to calculate the efficiency of the DC/DC converter. In multiphase converters, multiple inductors drive the same capacitor, and the current of each phase of the converter is monitored to ensure the current is shared equally between the different available phases.

SUMMARY

An apparatus includes a switch, a first current path, a second current path, a current mirror, first and second buffers, and a third variable resistor. The switch has a first terminal coupled to an output of the first current path and a second terminal configured to switch between a ground terminal or a low-side power transistor based on a control signal. The second current path has a current path output coupled to the ground terminal. The input of the first current path is coupled to an input of the current mirror, and the input of the second current path is coupled to a first output of the current mirror. Each of the first and second current paths includes: a respective transistor; a respective differential amplifier; and a respective variable resistor. The transistor has a control terminal, a first current terminal coupled to the input of the particular current path, and a second current terminal.

The differential amplifier has a positive input, a negative input coupled to the second current terminal, and an output coupled to the control terminal. The variable resistor is coupled between the negative input and the output of the particular current path. A second output of the current mirror is coupled to an input of the first buffer, which has an output. The second buffer has an input and an output, and the third variable resistor is coupled between the output of the second buffer and the input of the first buffer.

In some implementations, a gain stage is coupled between the second output of the current mirror and the input of the first buffer. The apparatus can also include an operational transconductance amplifier (OTA) and a capacitor. The OTA has a positive input coupled to the output of the second buffer, a negative input coupled to the output of the first buffer, and an output. The capacitor is coupled between the output of the OTA and the ground terminal, and the positive input of the differential amplifier in the first current path is coupled to the output of the OTA.

The apparatus can include a controller configured to set the output of the first buffer and the output of the second buffer to be equal at intervals, in some implementations. The controller can also adjust a resistance of the first, second and third variable resistors. The apparatus can further comprise a temperature sensing circuit and an analog-to-digital converter (ADC) in some implementations. The temperature sensing circuit measures a temperature of the apparatus, and the ADC converts an analog temperature signal from the temperature sensing circuit into a digital temperature signal. The controller adjusts the resistance of the first, second and third variable resistors based on the digital temperature signal.

In some implementations, the controller determines a variation in drain-source on resistance (Rdson) of the low-side power transistor over temperature and determines a first adjustment to the resistance of the first, second and third variable resistors for a first temperature range, and a second adjustment to the resistance of the first, second and third variable resistors for a second temperature range. For the first temperature range, the controller increases the resistance of the third variable resistor relative to the resistance of the first and second variable resistors. For the second temperature range, the controller increases the resistance of the first and second variable resistors relative to the resistance of the third variable resistor.

In some implementations, the controller is configured to adjust the resistance of the first, second and third variable resistors based on a variation in drain-source on resistance (Rdson) of the low-side power transistor.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A shows an example DC/DC buck converter having a current-sensing resistor.

FIG. 1B shows an example DC/DC buck converter having inductor DC resistance current sensing.

FIG. 1C shows an example DC/DC buck converter having drain-source on-resistance (Rdson) current sensing.

FIG. 1D shows waveforms of currents in the DC/DC buck converter having drain-source on-resistance current sensing of FIG. 1C.

FIG. 2 shows an example Rdson current sensing circuit.

FIG. 3 shows the example Rdson current sensing circuit of FIG. 2 having error correction.

FIG. 4 shows a graph of the value of Rdson over temperature.

FIG. 5 shows a graph of the percent gain error over temperature for the normalized Rdson of FIG. 4.

FIG. 6 shows a graph of the percent gain error over temperature for different correction factors at different temperature ranges.

FIG. 7 shows a graph of the normalized Rdson over supply voltage.

FIG. 8 shows waveforms of the output voltage, the voltage across the low-side power transistor, and the output current.

DETAILED DESCRIPTION

The same reference number is used in the drawings for the same or similar (either by function and/or structure) features. The described Rdson-based current sensing systems include a switch, first and second current paths, a current mirror, first and second buffers, and a variable resistor. The current mirror has first, second and third outputs; the first current path is coupled to the first output and to the switch, and the second current path is coupled to the second output and to ground. The third output is coupled to the first buffer. The switch switches between ground and a low-side power transistor based on a control signal.

Each of the first and second current paths includes a respective transistor, a respective differential amplifier, and a respective variable resistor. The transistor has a first current terminal coupled to the first current mirror output, a second current terminal, and a control terminal. The differential amplifier has a positive input at which the differential amplifier is configured to receive a first reference voltage, a negative input coupled to the second current terminal, and an output coupled to the control terminal. The variable resistor is coupled between the negative input and the output of the current path.

The second buffer receives a second reference voltage, and the third variable resistor is coupled between the second buffer and the first buffer. In some implementations, a gain stage is coupled between the third output of the current mirror and the first buffer. An operational transconductance amplifier (OTA): (a) receives voltages at the outputs of the first and second buffers; and (b) in an auto-zeroing mode of operation implemented at intervals, integrates the difference onto a capacitor coupled between the positive input of the differential amplifier in the first current path and the ground terminal.

FIG. 1A shows an example DC/DC buck converter 100A having a current-sensing resistor Rsense 130. The DC/DC buck converter 100A includes a controller 110, a high-side power transistor MH, a low-side power transistor ML, an inductor L 120, a capacitor C 140, and a current source Iload 145, which represents the current through the load of the DC/DC buck converter 100A. The high-side transistor MH and the low-side transistor ML are field-effect transistors (FETs). MH is a p-channel FET (PFET), and ML is an n-channel FET (NFET) in this example. In other examples, MH is an NFET, ML is a PFET, and/or one or both of MH and ML are bipolar junction transistors (BJTs). A BJT includes a base corresponding to the gate terminal, and a collector and an emitter corresponding to the drain and source terminals of a FET. The base of a BJT and the gate terminal of a FET are also called control inputs. The collector and emitter of a BJT and the drain and source terminals of a FET are also called current terminals.

MH is configured to receive an input voltage Vin 105 at its source terminal, and the drain terminal of MH is coupled to the drain terminal of ML. The source terminal of ML is coupled to ground 115. The gate terminals of MH and ML are coupled to controller 110. The inductor L 120 is coupled to the drain terminals of MH and ML and to the current-sensing resistor Rsense 130. The current IL 125 through the inductor L 120 is determined based on a voltage Vrsense 135 across Rsense 130, which is further coupled to the output voltage terminal Vo 150. The capacitor C 140 is coupled to the terminal Vo 150 and to ground 115. The current source Iload 145 is coupled between the terminal Vo 150 and ground 115. The controller is further coupled to the output voltage terminal Vo 150.

While the current-sensing resistor Rsense 130 enables accurate measurement of the current IL 125, Rsense 130 introduces a power loss that may be represented as:

Power loss=(IL 125)²(Rsense 130)  (1)

For high power, high current, high load applications, the power loss can become prohibitive. Also, measuring the voltage Vrsense 135 requires two pins, and may be difficult to scale to multiphase DC/DC buck converters.

FIG. 1B shows an example DC/DC buck converter 100B with inductor DC resistance (DCR) current sensing. The DC/DC buck converter 100B is similar to the DC/DC buck converter 100A of FIG. 1A, but omits the current-sensing resistor Rsense 130 and includes a resistor RL 165 that is representative of the DCR of the inductor L 120, a resistor Rdcr 170, and a capacitor Cdcr 175. The resistor RL 165 is coupled in series between the inductor L 120 and the output voltage terminal Vo 150. The resistor Rdcr 170 is coupled to the drain terminals of MH and ML and the inductor L120, and to the capacitor Cdcr 175, which is further coupled to the output voltage terminal Vo 150.

The time constants are selected to make the product of Rdcr 170 and Cdcr 175 proportional to the ratio of the inductance of inductor L 120 to the resistor RL 165, which may be represented as:

$\begin{matrix} {{\left( {{Rdcr}170} \right)\left( {{Cdcr}175} \right)} = \frac{L120}{RL165}} & (2) \end{matrix}$

The voltage Vdcrsense 180 across the capacitor Cdcr 175 is then proportional to the current IL 125 through inductor L120:

Vdcrsense 180=(IL 125)(RL 165)  (3)

The DCR-based sensing technique in the DC/DC buck converter 100B is more efficient than the current-sensing resistor Rsense 130 of FIG. 1A, but the values of Rdcr 170 and Cdcr 175 must be selected to make the time constants matched. The voltage Vdcrsense 180 can experience very low signal swing, as the resistance RL 165 is selected to be very small to reduce the voltage drop across it. Also, measuring the voltage Vdcrsense 180 uses two pins, and may be difficult to scale for multiphase DC/DC buck converters.

FIG. 1C shows an example DC/DC buck converter 100C with drain-source on-resistance (Rdson) current sensing. The DC/DC buck converter 100C is similar to the DC/DC buck converter 100A of FIG. 1A, but omits the current-sensing resistor Rsense 130. In Rdson current sensing, the voltage Vrds 190 across the high-side power transistor MH or across the low-side power transistor ML is measured. In this example, the voltage Vrds 190 is measured across the transistor MH, and the Vrds 190 is used to determine the current IMH 185 through the transistor and the current IL 125 through the inductor L 120.

FIG. 1D shows waveforms of the current IMH 185 through the transistor MH and the current IL 125 through the inductor L 120 in the DC/DC buck converter 100C of FIG. 1C. The current IMH 185 is useful to determine the rising edge of IL 125. For a Vrds 190 measured across the low-side transistor ML, the current IML through the transistor ML is useful to determine the falling edge of IL 125. Using the input voltage Vin 105, the output voltage Vo 150, the inductance of inductor L 120, and either of IMH 185 and IML, both the rising and falling edges of IL 125 can be reconstructed.

The Rdson current sensing technique relies on a single pin to measure the voltage Vrds 190 across either the high-side transistor MH or the low-side transistor ML, which can be scaled to multiphase DC/DC buck converters. However, variations in temperature and supply voltage impact the value of Rdson, resulting in inaccurate current sensing. However, a front-end Vrds 190 voltage-sensing circuit for the low-side transistor ML can compensate for variations in temperature and supply voltage.

FIG. 2 shows an example front-end Rdson current-sensing circuit 200 for a low-side power transistor represented as the resistor Rdson 210. The current-sensing circuit 200 is described herein with respect to the DC/DC buck converters 100C of FIG. 1C. The current-sensing circuit 200 includes a switch 220, variable resistors R 230A-B and 280, differential amplifiers 238A-B, transistors M 240A-B, the current mirror 250, an optional gain stage 260, and buffers 270 and 290. The transistors M 240A-B are NFETs in this example. But in other implementations, one or more of M 240A-B are PFET(s) and/or BJT(s).

The low-side power transistor represented by Rdson 210 is coupled to ground 205. The voltage VSW 215 is measured across Rdson 210, and the current IL 125 through the inductor L 120 flows through Rdson 210 while ML is turned on. The variable resistor R 230A is coupled to the negative input of the differential amplifier 238A and to the source terminal of M 240A and to the switch 220, which couples variable R 230A to ground 205 or Rdson 210 based on the control signal CTL 225. The control signal CTL 225 causes R 230A to be coupled to ground 205 while ML is turned off and to Rdson 210 while ML is turned on. The differential amplifier 238A is configured to receive a reference voltage Vref 234 at its positive input, and the output of the differential amplifier 238A is coupled to the gate terminal of M 240A. The current Ia 245A through the transistor M 240A is generated based on the reference voltage Vref 234 and the resistance from the negative input of the amplifier 238A to ground 205, including the resistor R 230A and Rdson 210. The drain terminal of M 240A is coupled to an input of the current mirror 250. The current mirror 250 mirrors the input current Ia 245A and provides it as the current Ib 245B.

The variable resistor R 230B is coupled to the negative input of the differential amplifier 238B and to the source terminal of M 240B and to ground 205. The differential amplifier 238B is configured to receive Vref 234 at its positive input, and the output of the differential amplifier 238B is coupled to the gate terminal of M 240B. The drain terminal of M 240B receives the current Ib 245B from the current mirror 250. The current mirror provides a current Ic 255 to the optional gain stage 260. The current Ic 255 can be represented as:

Ic 255=Ia 245A−Ib 245B  (4)

The optional gain stage 260 provides a current Id 265, which can be represented as:

Id 265=G(Ic 255)=G(Ia 245A−Ib 245B)  (5)

where G represents the gain of gain stage 260. The current Id 265 is provided to the variable resistor R 280, which is coupled between the output of the optional gain stage 260 and the output of the buffer 290. The buffer 290 is configured to: receive a reference voltage REFIN 295, which sets the common mode voltage; and provide the voltage VMN 285 to one terminal of the variable resistor R 280. The voltage at the other terminal of the variable resistor R 280 is based on the voltage VMN 285 and the current Id 265, and is provided to the input of buffer 270, which provides the voltage VMP 275.

The voltage VMP 275 is a voltage equivalent to the inductor current IL 125, and may be represented as:

VMP 275=Vref 234+(IL 125)(G)  (6)

where Vref 234 represents a common mode or offset voltage, and the gain G is expressed as volts per ampere (V/A). While the low-side transistor ML is turned on, the voltage VSW 215 may be represented as:

VSW 215=(Rdson 210)(−IL 125)  (7)

The current Ia 245A through the resistor R 230A may be represented as:

$\begin{matrix} {{Ia}{{245A} = \frac{{Vref234} - {VSW215}}{R230A}}} & (8) \end{matrix}$

The current Ib 245B through the resistor R 230B may be represented as:

Ib 245B=Vref 234/R 230B  (9)

The output voltage VMP 275 can be rewritten as:

$\begin{matrix} {{{VMP}275} = {{\left( {\frac{{{Vref}234} - {{VSW}215}}{R230A} - \frac{Vref234}{R230B}} \right)(G)\left( {R280} \right)} + {VMN285}}} & (10) \end{matrix}$

By choosing the resistances of R 230A and R 230B to be equal, the output voltage VMP 275 can be simplified to:

$\begin{matrix} {{{VMP}275} = {{\left( {- \frac{VSW215}{R230A}} \right)(G)\left( {R280} \right)} + {{VMN}285}}} & (11) \end{matrix}$

Substituting in the definition of VSW 215, the output voltage VMP 275 can be represented as:

$\begin{matrix} {{{VMP}275} = {\left( \frac{\left( {{IL}125} \right)\left( {Rd{son}210} \right)(G)\left( {R280} \right)}{R230A} \right) + {{VMN}285}}} & (12) \end{matrix}$

As a result, the common mode voltage at zero current can be set using VMN 285 and by extension, REFIN 295. Variations in the value of Rdson 210 can be compensated by varying the ratio of the resistance of R 280 to the resistance of R 230A, which is equal to the resistance of R 230B. In one example, when the current-sensing circuit 200 is used for high bandwidth applications, the resistances of R 230A and R 230B are fixed, and the resistance of R 280 is varied. In another example, the resistances of R 230A and R 230B are varied, and the resistance of R 280 is fixed, when the current-sensing circuit 200 is used for high bandwidth applications. The gain can be adjusted using the optional gain stage 260. However, the differential amplifier offsets, inaccuracies in the current mirror 250, and the like can introduce inaccuracy into the output voltage VMP 275 and by extension the calculations of IL 125.

Ideally for zero current, VMP 275 is equal to VMN 285, so forcing VMP 275 to be equal to VMN 285 at intervals is useful to compensate for nonidealities in the current sensing circuit 200. The error between VMP 275 and VMN 285 is integrated and used as a reference for the differential amplifier 238A, and any error between VMP 275 and VMN 285 for zero load current will be adjusted. FIG. 3 shows an example Rdson current sensing circuit 300 with error correction. The Rdson current sensing circuit 300 is similar to the Rdson current sensing circuit 200 of FIG. 2, but also includes: an operational transconductance amplifier (OTA) 310; a capacitor 315; switches 325, 335 and 345; a temperature sensing circuit 355; an analog-to-digital converter (ADC) 365; and a controller 370.

The OTA 310 has: (a) a positive input at which the OTA 310 is configured to receive VMN 285; and (b) a negative input at which the OTA 310 is configured to receive VMP 275. The output of OTA 310 is coupled to switch 325, which opens and closes based on the control signal CTL 330. The switch 325 couples the output of OTA 310 to a terminal of the capacitor C 315. The capacitor 315 is further coupled to ground 205. The switch 335 couples the terminal of capacitor C 315 to the positive input of differential amplifier 238A based on the control signal CTL 340. The controller 370 may generate the control signals 330, 340 and 350 for switches 325, 335 and 345, respectively, so autozeroing is performed at intervals.

During autozeroing: (a) the switch 335 opens, thereby disconnecting the capacitor C 315 from the positive input of differential amplifier 238A; and (b) the switch 325 closes, thereby connecting the capacitor C 315 to the output of the OTA 310. The output of OTA 310 provides a current to the capacitor C 315, which stores the value of the error between VMP 275 and VMN 285 as a corrected reference voltage −Vref 320. The corrected reference voltage −Vref 320 compensates for errors introduced by the differential amplifier offsets, inaccuracies in the current mirror 250, and the like. The capacitance of C 315 and the length of time between autozeroing can be selected to prevent error leakage.

While the switch 335 is open and the corrected reference voltage −Vref 320 across the capacitor C 315 is disconnected from the positive input of differential amplifier 238A, the control signal CTL 350 causes switch 345 to be closed, and the positive input of the differential amplifier 238A receives the reference voltage Vref 234. After the autozeroing has been completed, the switch 345 is opened, thereby disconnecting the reference voltage Vref 234 from the positive input of the differential amplifier 238A. The switch 325 is opened, thereby disconnecting C 315 from the output of OTA 310. Also, the switch 335 is closed, thereby connecting C 315 to the positive input of the differential amplifier 238A and providing the corrected reference voltage −Vref 320 across the capacitor C 315 to it. The controller 370 receives the output voltage VMP 275 and reconstructs the current IL 125 through the inductor L 120 based on VMP 275.

Although errors introduced by the current sensing circuit 300 are corrected, variations in Rdson 210 based on temperature and supply voltage can still result in inaccurate current sensing. However, the variation of Rdson 210 with respect to temperature is a known characteristic of the transistor ML, and so the ratio of the resistance of R 280 to the resistance of R 230A can be adjusted to compensate for the temperature variations in Rdson 210 using the control signals CTL_R 230A-B 375 and CTL_R 280 380 from controller 370.

Ignoring the common mode term VMN 285, VMP 275 can be represented as:

$\begin{matrix} {{{VMP}275} = \left( \frac{\left( {{IL}125} \right)\left( {Rd{son}210} \right)(G)\left( {R280} \right)\left( \frac{{Rdson}\_{roomtemp}}{{Rdson}\_{roomtemp}} \right)}{R230A} \right)} & (13) \end{matrix}$

where Rdson_roomtemp represents the impedance of the low-side transistor ML at room temperature. The normalized value Rdson_norm of Rdson 210 with respect to room temperature can be represented as:

$\begin{matrix} {{{Rdson}\_{norm}} = \frac{Rd{son}210}{{Rdson}\_{roomtemp}}} & (14) \end{matrix}$

Substituting the normalized Rdson_norm into equation (13), VMP 275 can be represented as:

$\begin{matrix} {{{VMP}275} = \left( \frac{\left( {{IL}125} \right)\left( {{Rdson}\_{roomtemp}} \right)\left( {{Rdson}\_{norm}} \right)(G)\left( {R280} \right)}{R230A} \right)} & (15) \end{matrix}$

As equation 15 illustrates, Rdson_norm varies with respect to temperature, and the ratio of the resistance of R 280 to the resistance of R 230A can be adjusted to make the product of Rdson_norm and (R 280/R 230A) remain constant with respect to temperature. The effective VMP 275 can be represented as:

VMP 275=(IL 125)(Rdson__roomtemp)(G_effective)  (16)

where G_effective can be represented as:

$\begin{matrix} {{G{\_ effective}} = {(G)\left( \frac{R280}{R230A} \right)\left( {{Rdson}\_{norm}} \right)}} & (17) \end{matrix}$

To determine how to adjust the resistances of R 230A-B and R 280, the variation of Rdson 210 with respect to temperature is measured. In one example, when the current-sensing circuit 200 is used for high bandwidth applications, the resistances of R 230A and R 230B are fixed, and the resistance of R 280 is varied. In another example, the resistances of R 230A and R 230B are varied, and the resistance of R 280 is fixed, when the current-sensing circuit 200 is used for high bandwidth applications.

FIG. 4 shows a graph 400 of the value 410 of Rdson 210 over temperature, ranging from −40 degrees Celsius (° C.) to 160° C. After the values 410 of Rdson 210 over temperature are determined, a best-fit curve 420 may be calculated to obtain the temperature coefficients. The on-chip temperature sensing circuit 355 determines temperature information TAO 360 for the integrated circuit, which is a voltage and can be represented as:

TAO 360=mx+b  (18)

where b represents the value of TAO 360 at zero degrees Celsius (C), m represents the slope in V/° C., and x represents the determined temperature of the integrated circuit in ° C. For the example best fit curve 420 of FIG. 4, TAO 360 is equal to 0.6V at 0° C., and 0.8V at room temperature, so b is equal to 0.6V, and m is equal to 8 mV/° C. For most temperatures, the first order coefficient of the best fit curve 420 is sufficient for the slope m.

TAO 360 is digitized by the ADC 365, and the resulting digital temperature information is provided to the controller 370, which adjusts the ratio of the resistance of R 280 to the resistance of R 230A based on the variation of Rdson_norm across temperature using the control signals CTL_R 230A-B 375 and CTL_R 280 380. For an N-bit ADC, the desired resistance value of R 230A can be represented as:

$\begin{matrix} {{R230A} = {\left( {RA} \right) + \frac{\left( {LSB1} \right)\left( 2^{N} \right)(m)(T)}{V{ref}234}}} & (19) \end{matrix}$

where RA represents a resistance of R 230A at zero degrees Celsius, LSB1 represents the first least significant bit of the digital temperature information from the ADC 365, and T represents the measured temperature of the integrated circuit. The resistance of R 230B is set to be equal to the resistance of R 230A.

The desired resistance value of R 280 can be represented as:

$\begin{matrix} {{R280} = {{R\_{init}} - \frac{\left( {LSB3} \right)\left( 2^{N} \right)(m)(T)}{V{ref}234}}} & (20) \end{matrix}$

where R_init represents a resistance of R 280 at zero degrees Celsius, and LSB3 represents the third least significant bit of the digital temperature information from the ADC 365. Because Rdson_norm has a positive temperature coefficient, the ratio of R 280 to R 230A is negative, and the desired resistance of R 280 has a negative temperature coefficient. The ratio of R 280 to R 230A can be represented as:

$\begin{matrix} {\frac{R280}{R230A} = {{\left( \frac{R\_{init}}{RA} \right)\left\lbrack {1 - \left( \frac{\left( {LSB3} \right)\left( 2^{N} \right)(m)(T)}{\left( {V{ref}234} \right)\left( {R\_{init}} \right)} \right)} \right\rbrack}\left\lbrack {1 - \left( \frac{\left( {LSB1} \right)\left( 2^{N} \right)(m)(T)}{\left( {V{ref}234} \right)\left( {RA} \right)} \right)} \right\rbrack}} & (21) \end{matrix}$ $\begin{matrix} {\frac{R280}{R230A} = {\left( \frac{R\_{init}}{RA} \right)\left\lbrack {1 - {\left( {X + Y} \right)T}} \right\rbrack}} & (22) \end{matrix}$

where X is represented as:

$\begin{matrix} {X = \frac{\left( {{LSB}3} \right)\left( 2^{N} \right)(m)}{\left( {V{ref}234} \right)\left( {R\_{init}} \right)}} & (23) \end{matrix}$

and Y is represented as:

$\begin{matrix} {Y = \frac{\left( {LSB1} \right)\left( 2^{N} \right)(m)}{\left( {V{ref}234} \right)\left( {RA} \right)}} & (24) \end{matrix}$

The controller 370 adjusts the linear coefficient −(X+Y) to compensate for the positive temperature coefficient of the best fit curve 420. Although the ratio of R 280 to R 230A should compensate for variations in Rdson_norm, the current sense gain can still vary and introduce errors. FIG. 5 shows a graph 500 of the percent gain error 530 over temperature for the adjusted linear coefficient −(X+Y). The percent gain error 530 ranges from approximately 3.5% to −0.5% across approximately 200° C., from −40° C. to about 150° C. The percent gain error 530A over the first temperature range Trange 510 is nonlinear, indicating that the second order term of the best fit curve 420 dominates. The percent gain error 530B over the second temperature range Trange 520 is linear, indicating that the first order term of the best fit curve 420 dominates.

The controller 370 can apply a first correction factor for the nonlinear term in Trange 510 and a second correction factor for the linear term in Trange 520. For temperatures in Trange 510, controller 370 increases the resistance of R 280 relative to R 230A. For temperatures in Trange 520, controller 370 increases the resistance of R 230A relative to R 280. FIG. 6 shows a graph of the percent gain error 630 over temperature for different correction factors at different temperature ranges. The percent gain error 630 ranges from approximately 0.5% to −0.5% across approximately 200° C., from −40° C. to about 150° C., showing the further reduction in error by using different correction factors in temperature ranges Trange 510 and Trange 520. In this implementation, the temperature range is divided into two ranges Trange 510 and Trange 520. But in other implementations, three or more temperature ranges can be used to further increase the accuracy of the gain.

The splitting of the temperature range into two or more temperature ranges and applying different correction factors to the different temperature ranges is called binning. In one example, in a particular temperature range, binning is realized by keeping resistance of one of R 230A/R 230B or R 280 fixed and varying the other. In a first example of Trange 510, the resistances of R 230A and R 230B are fixed, and the resistance of R 280 is varied. And in Trange 520 of the first example, the resistances of R 230A and R 230B are varied, and the resistance of R 280 is fixed. In a second example of Trange 510, the resistances of R 230A and R 230B are fixed to a first value, and the resistance of R 280 is varied. And in Trange 520 of the second example, the resistances of R 230A and R 230B are fixed to a second value, and the resistance of R 280 is varied. This arrangement makes the circuit 200 or the circuit 300 useful in high bandwidth applications.

Despite the high-accuracy of the temperature compensation, the current sensing circuit may still have errors caused by variations in Rdson 210 due to variations in the supply voltage. FIG. 7 shows a graph 700 of the normalized Rdson_norm 710 of Rdson 210 over supply voltage Vdd. The controller 370 may adjust the slope m or the offset b of the temperature information TAO 360 to compensate for supply voltage variations. For an 8-bit ADC, the 2-bit programmability for adjusting the slope m or the offset b of TAO 360 is sufficient to compensate for the smaller variation in Rdson 210 over supply voltage compared to the larger variation in Rdson 210 over temperature.

The controller 370 may trim the current mirror 250 to compensate for process variations in the Rdson 210. The output voltage VMP 275 is almost entirely independent of error, because: (a) the controller 370 compensates for variations in Rdson 210 across temperature, supply voltage and process variations; and (b) the autozeroing process with OTA 310 compensates for errors introduced by the differential amplifier offsets, inaccuracies in the current mirror 250, and the like. Controller 370 can reconstruct an output current Iout 810 of FIG. 8 to mimic the inductor current IL 125 based on VSW 215 across the low-side transistor ML and VMP 275 provided from the Rdson current sensing circuit 300 of FIG. 3.

For example, controller 370 can generate Iout 810 using an amplitude locked loop and the slope and valley information of the VMP 275. The charging and discharging current within the amplitude locked loop creates a sawtooth waveform that can be compared with VMP 275. The differences in slope and valley transition points are useful to adjust the charging and discharging currents until the slope and valley transition points are aligned. The timing of Iout 810 is extracted from VSW 215.

For example, at time t0, VSW 215 transitions from above 0V to a negative supply voltage, and Iout 810 transitions from increasing to decreasing. At time t3, VSW 215 transitions from the negative supply voltage to above 0V, and Iout 810 transitions from decreasing to increasing. At time t4, VSW transitions from above 0V to the negative supply voltage, and Iout 810 transitions from increasing to decreasing. The magnitudes of the charging and discharging currents used to generate Iout 810 are adjusted to make the slope of VMP 275 between time t1 and t2 approximately equal to the slope of Iout 810 between time t0 and t3.

In this description, the term “couple” may cover connections, communications, or signal paths that enable a functional relationship consistent with this description. For example, if device A generates a signal to control device B to perform an action, then: (a) in a first example, device A is coupled to device B by direct connection; or (b) in a second example, device A is coupled to device B through intervening component C if intervening component C does not alter the functional relationship between device A and device B, so device B is controlled by device A via the control signal generated by device A.

In this description, a device that is “configured to” perform a task or function may be configured (e.g., programmed and/or hardwired) at a time of manufacturing by a manufacturer to perform the function and/or may be configurable (or reconfigurable) by a user after manufacturing to perform the function and/or other additional or alternative functions. The configuring may be through firmware and/or software programming of the device, through a construction and/or layout of hardware components and interconnections of the device, or a combination thereof.

As used herein, the terms “terminal,” “node,” “interconnection,” “pin” and “lead” are used interchangeably. Unless specifically stated to the contrary, these terms generally mean an interconnection between or a terminus of a device element, a circuit element, an integrated circuit, a device or other electronics or semiconductor component.

A circuit or device that is described herein as including certain components may instead be adapted to be coupled to those components to form the described circuitry or device. For example, a structure described as including one or more semiconductor elements (such as transistors), one or more passive elements (such as resistors, capacitors, and/or inductors), and/or one or more sources (such as voltage and/or current sources) may instead include only the semiconductor elements within a single physical device (e.g., a semiconductor die and/or integrated circuit (IC) package) and may be adapted to be coupled to at least some of the passive elements and/or the sources to form the described structure either at a time of manufacture or after a time of manufacture, such as by an end-user and/or a third-party.

While the use of particular transistors is described herein, other transistors (or equivalent devices) may be used instead. For example, a PFET may be used in place of an NFET with little or no changes to the circuit. Furthermore, other types of transistors may be used (such as bipolar junction transistors (BJTs)).

Circuits described herein are reconfigurable to include additional or different components to provide functionality at least partially similar to functionality available before the component replacement. Components shown as resistors, unless otherwise stated, are generally representative of any one or more elements coupled in series and/or parallel to provide an amount of impedance represented by the resistor shown. For example, a resistor or capacitor shown and described herein as a single component may instead be multiple resistors or capacitors, respectively, coupled in parallel between the same terminals. For example, a resistor or capacitor shown and described herein as a single component may instead be multiple resistors or capacitors, respectively, coupled in series between the same two terminals as the single resistor or capacitor.

Uses of the phrase “ground” in this description include a chassis ground, an Earth ground, a floating ground, a virtual ground, a digital ground, a common ground, and/or any other form of ground connection applicable to, or suitable for, the teachings of this description. Unless otherwise stated, “about,” “approximately” or “substantially” preceding a value means +/−10 percent of the stated value.

Modifications are possible in the described examples, and other examples are possible, within the scope of the claims. 

What is claimed is:
 1. An apparatus, comprising: a switch having a first terminal and a second terminal, the second terminal configured to switch between a ground terminal or a low-side power transistor based on a control signal; a first current path and a second current path, the first current path having a current path output coupled to the second terminal of the switch, the second current path having a current path output coupled to the ground terminal, and each of the first and second current paths including: a respective transistor having a control terminal, a first current terminal coupled to an input of the current path, and a second current terminal; a respective differential amplifier having a positive input, a negative input coupled to the second current terminal, and an output coupled to the control terminal; a respective variable resistor coupled between the negative input and the current path output; a current mirror having an input coupled to the input of the first current path, a first output coupled to the input of the second current path, and a second output; a first buffer having an input and an output, the input of the first buffer coupled to the second output of the current mirror; a second buffer having an input and an output; and a third variable resistor coupled between the output of the second buffer and the input of the first buffer.
 2. The apparatus of claim 1, further comprising a gain stage coupled between the second output of the current mirror and the input of the first buffer.
 3. The apparatus of claim 1, further comprising: an operational transconductance amplifier (OTA) having an output, a positive input coupled to the output of the second buffer, and a negative input coupled to the output of the first buffer; and a capacitor coupled between the output of the OTA and the ground terminal; wherein the positive input of the first differential amplifier is coupled to the output of the OTA.
 4. The apparatus of claim 3, further comprising a controller configured to set the output of the first buffer and the output of the second buffer to be equal at intervals.
 5. The apparatus of claim 4, wherein the controller is configured to adjust a resistance of the first, second and third variable resistors.
 6. The apparatus of claim 5, further comprising: a temperature sensing circuit configured to measure a temperature of the apparatus; and an analog-to-digital converter (ADC) configured to convert an analog temperature signal from the temperature sensing circuit into a digital temperature signal; wherein the controller is configured to adjust the resistance of the first, second and third variable resistors based on the digital temperature signal.
 7. The apparatus of claim 6, wherein the controller is configured to: determine a variation in drain-source on resistance (Rdson) of the low-side power transistor over temperature; and determine a first adjustment to the resistance of the first, second and third variable resistors for a first temperature range, and determine a second adjustment to the resistance of the first, second and third variable resistors for a second temperature range.
 8. The apparatus of claim 7, wherein: for the first temperature range, the controller is configured to increase the resistance of the third variable resistor relative to the resistance of the first and second variable resistors; and for the second temperature range, the controller is configured to increase the resistance of the first and second variable resistors relative to the resistance of the third variable resistor.
 9. The apparatus of claim 6, wherein the controller is configured to adjust the resistance of the first, second and third variable resistors based on a variation in drain-source on resistance (Rdson) of the low-side power transistor.
 10. A device, comprising: a current mirror having a current mirror input, a first current mirror output, and a second current mirror output; a switch configured to switch between a ground terminal or a low-side power transistor based on a control signal; a first current path coupled between the current mirror input and the switch and configured to receive a first reference voltage; a second current path coupled between the first current mirror output and the ground terminal and configured to receive a second reference voltage; a first buffer coupled to the second current mirror output and having a first buffer output; a second buffer configured to receive a third reference voltage; a variable resistor coupled between the second buffer and the first buffer; a temperature-sensing circuit having a temperature-sensing circuit output, the temperature-sensing circuit configured to provide a device temperature at the temperature-sensing circuit output; and a controller coupled to the first buffer output and the temperature-sensing circuit output and configured to: determine a first adjustment to the first and second current paths and a second adjustment to a resistance of the variable resistor based on the device temperature; and determine a current through the low-side power transistor based on a voltage at the first buffer output and a voltage between the switch and the ground terminal.
 11. The device of claim 10, wherein the variable resistor is a first variable resistor, and the first current path includes: a transistor having a control terminal, a first current terminal coupled to the current mirror input, and a second current terminal; a differential amplifier having a positive input, a negative input coupled to the second current terminal, and an output coupled to the control terminal, the differential amplifier configured to receive the first reference voltage at the positive input; and a second variable resistor coupled between the negative input and the switch.
 12. The device of claim 11, wherein the transistor is a first transistor, the control terminal is a first control terminal, the differential amplifier is a first differential amplifier, and the second current path includes: a second transistor having a second control terminal, a third current terminal coupled to the first current mirror output, and a fourth current terminal; a second differential amplifier having a positive input, a negative input coupled to the fourth current terminal, and an output coupled to the second control terminal, the second differential amplifier configured to receive the second reference voltage at the positive input; and a third variable resistor coupled between the negative input of the second differential amplifier and the ground terminal.
 13. The device of claim 12, further comprising: an operational transconductance amplifier (OTA) having a positive input coupled to an output of the second buffer, a negative input coupled to the first buffer output, and an OTA output; and a capacitor coupled between the OTA output and the ground terminal; wherein a voltage across the capacitor is the first reference voltage.
 14. The device of claim 13, wherein: the controller is configured to set, at intervals, a voltage at the first buffer output equal to a voltage at the output of the second buffer; the OTA is configured to integrate a difference between the voltage at the first buffer output and the voltage at the output of the second buffer; and the capacitor is configured to store the difference between intervals.
 15. The device of claim 12, wherein the first adjustment to the first and second current paths includes an adjustment to a resistance of the second and third variable resistors.
 16. The device of claim 15, wherein the controller is configured to: determine a variation in drain-source on resistance (Rdson) of the low-side power transistor across temperature; and determine the first adjustment to the resistance of the second and third variable resistors and the second adjustment to the first variable resistor based on the variation in Rdson and the device temperature.
 17. The device of claim 16, wherein the controller is configured to determine the first and second adjustments by: determining, for a first temperature range, a third adjustment to the resistance of the second and third variable resistors and a fourth adjustment to the resistance of the first variable resistor, in which the resistance of the first variable resistor is increased relative to the resistance of the second and third variable resistors; and determining, for a second temperature range, a fifth adjustment to the resistance of the second and third variable resistors and a sixth adjustment to the resistance of the first variable resistor, in which the resistance of the second and third variable resistors is increased relative to the resistance of the first variable resistor; wherein: the first adjustment to the resistance of the second and third variable resistors includes the third and fifth adjustments; and the second adjustment to the resistance of the first variable resistor includes the fourth and sixth adjustments.
 18. The device of claim 10, further comprising an optional gain stage coupled between the second current mirror output and the first buffer.
 19. A system, comprising: a current mirror having a current mirror input, a first current mirror output, and a second current mirror output; a switch configured to switch between a ground terminal or a low-side power transistor based on a control signal; a first current path including: a first transistor having a first control terminal, a first current terminal coupled to the current mirror input, and a second current terminal; a first differential amplifier having a positive input, a negative input coupled to the second current terminal, and an output coupled to the first control terminal, the first differential amplifier configured to receive a first reference voltage at the positive input; and a first variable resistor coupled between the negative input and the switch; a second current path including: a second transistor having a second control terminal, a third current terminal coupled to the first current mirror output, and a fourth current terminal; a second differential amplifier having a positive input, a negative input coupled to the fourth current terminal, and an output coupled to the second control terminal, the second differential amplifier configured to receive a second reference voltage at the positive input; and a second variable resistor coupled between the negative input of the second differential amplifier and the ground terminal; a first buffer coupled to the second current mirror output and having a first buffer output; a second buffer configured to receive a third reference voltage; and a third variable resistor coupled between the second buffer and the first buffer.
 20. The system of claim 19, further comprising: an operational transconductance amplifier (OTA) having a positive input coupled to an output of the second buffer, a negative input coupled to the first buffer output, and an OTA output; and a capacitor coupled between the OTA output and the ground terminal; wherein a voltage across the capacitor is the first reference voltage.
 21. The system of claim 20, further comprising: a temperature-sensing circuit having a temperature-sensing circuit output, the temperature-sensing circuit configured to provide a system temperature at the temperature-sensing circuit output; a controller coupled to the first buffer output and the temperature-sensing circuit output and configured to: determine a first adjustment to a resistance of the first and second variable resistors and a second adjustment to a resistance of the third variable resistor based on the system temperature; and determine a current through the low-side power transistor based on a voltage at the first buffer output and a voltage between the switch and the ground terminal.
 22. The system of claim 21, wherein the controller is configured to: determine a variation in drain-source on resistance (Rdson) of the low-side power transistor across temperature; and determine the first adjustment to the resistance of the first and second variable resistors and the second adjustment to the third variable resistor based on the variation in Rdson and the system temperature.
 23. The system of claim 22, wherein the controller is configured to determine the first and second adjustments by: determining, for a first temperature range, a third adjustment to the resistance of the first and second variable resistors and a fourth adjustment to the resistance of the third variable resistor, in which the resistance of the third variable resistor is increased relative to the resistance of the first and second variable resistors; and determining, for a second temperature range, a fifth adjustment to the resistance of the first and second variable resistors and a sixth adjustment to the resistance of the third variable resistor, in which the resistance of the first and second variable resistors is increased relative to the resistance of the third variable resistor; wherein: the first adjustment to the resistance of the first and second variable resistors includes the third and fifth adjustments; and the second adjustment to the resistance of the third variable resistor includes the fourth and sixth adjustments. 